<?php
/**
 * Patient Signal view page. Used in display an signal record in search result in index action in PatientSignalController.
 *
 * @package   views
 * @subpackage patientSignal
 * @since     1.0
 * @filesource
 */
?>
<div class="singal-view">
<!-- Total span is 21  -->
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('subject')); ?></div>
<div class="span-15"><?php 
	if(Yii::app()->user->checkAccess('signalView',array(
		'organizationId'=>$data->organizationId
	))){
		echo CHtml::link(CHtml::encode($data->subject), array('view', 'id'=>$data->id),array('class'=>'icon icon-zoom'));
	}else{
		echo CHtml::encode($data->subject);
	}
	?></div>
<div class="span-2 last">#<?php echo CHtml::encode($data->id); ?></div>
<div class="clear"></div>

<div class="span-4">Age</div>
<div class="span-7"><?php echo CHtml::encode($data->ageYear).' Year(s) '.CHtml::encode($data->ageMonth).' Month(s)'; ?></div>
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('recordingTime')); ?></div>
<div class="span-5 last"><?php echo CHtml::encode($data->recordingTime); ?></div>
<div class="clear"></div>

<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('disorderId')); ?></div>
<div class="span-7"><?php echo CHtml::encode($data->disorder->name); ?></div>
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('createDate')); ?></div>
<div class="span-5 last"><?php echo CHtml::encode($data->createDate); ?></div>
<div class="clear"></div>

<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('gender')); ?></div>
<div class="span-16 last"><?php echo CHtml::encode(DataUtil::getGender($data->gender)); ?></div>
<div class="clear"></div>

<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('organizationId')); ?></div>
<div class="span-16 last"><?php echo CHtml::encode($data->organization->name); ?></div>
<div class="clear"></div>
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('status')); ?></div>
<div class="span-16 last"><?php 
	switch ($data->status){
		case PatientSignal::STATUS_NOT_PROCESSED:
			echo 'Not processed';
			break;
		case PatientSignal::STATUS_PROCESSING:
			echo 'Signal files are being processed, please check later.';
			break;
		case PatientSignal::STATUS_PROCESSED:
			echo CHtml::link('Download result',array('downloadResult','id'=>$data->id));
			break;
	}

	?></div>
<div class="clear"></div>

</div>
